<template>
  <div>
    <van-nav-bar left-text="返回" left-arrow @click-left="onClickLeft" color="black"/>

    <div class="logo">
    <img src="../assets/images/logo.png"/>
    </div>

    <van-form @submit="onSubmit">
      <van-field
        v-model="username"
        name="手机号"
        label="手机号:"
        placeholder="手机号"
        :rules="[{ required: true, message: '请填写手机号' }]"
      />
      <van-field
        v-model="password"
        type="password"
        name="密码"
        label="密码:"
        placeholder="密码"
        :rules="[{ required: true, message: '请填写密码' }]"
      />
      <div style="margin: 16px;">
        <van-button round block type="danger" native-type="submit"
          >登录</van-button
        >
      </div>
    </van-form>
  </div>
</template>

<script>
export default {
  name: "Login",
  data() {
    return {
      username: "",
      password: ""
    };
  },
  methods: {
    onSubmit(values) {
      console.log("submit", values);
    },
    onClickLeft() {
      this.$router.back();
    }
  }
};
</script>
<style scoped>
.logo{
  height:80px;
  line-height:80px;
  margin: 80px auto 40px;
  text-align:center;
}
.logo img{
  height:70px;
  width:20%;
}
.van-nav-bar{
  color:black;
}
</style>
